home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7539 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 0a | 50 61 74 68 3a 20 64 69 |.lang.c.|Path: di|
|00000020| 73 63 75 73 2e 74 65 63 | 68 6e 69 6f 6e 2e 61 63 |scus.tec|hnion.ac|
|00000030| 2e 69 6c 21 63 73 64 21 | 65 6d 69 6c 64 0a 46 72 |.il!csd!|emild.Fr|
|00000040| 6f 6d 3a 20 4b 6f 68 6e | 20 45 6d 69 6c 20 44 61 |om: Kohn| Emil Da|
|00000050| 6e 20 3c 65 6d 69 6c 64 | 40 63 73 2e 74 65 63 68 |n <emild|@cs.tech|
|00000060| 6e 69 6f 6e 2e 61 63 2e | 69 6c 3e 0a 53 75 62 6a |nion.ac.|il>.Subj|
|00000070| 65 63 74 3a 20 52 65 3a | 20 6d 6f 72 65 20 70 72 |ect: Re:| more pr|
|00000080| 6f 62 6c 65 6d 73 20 77 | 69 74 68 20 71 73 6f 72 |oblems w|ith qsor|
|00000090| 74 20 0a 43 6f 6e 74 65 | 6e 74 2d 54 79 70 65 3a |t .Conte|nt-Type:|
|000000a0| 20 54 45 58 54 2f 50 4c | 41 49 4e 3b 20 63 68 61 | TEXT/PL|AIN; cha|
|000000b0| 72 73 65 74 3d 55 53 2d | 41 53 43 49 49 0a 4f 72 |rset=US-|ASCII.Or|
|000000c0| 67 61 6e 69 7a 61 74 69 | 6f 6e 3a 20 54 65 63 68 |ganizati|on: Tech|
|000000d0| 6e 69 6f 6e 2c 20 49 73 | 72 61 65 6c 20 49 6e 73 |nion, Is|rael Ins|
|000000e0| 74 69 74 75 74 65 20 6f | 66 20 54 65 63 68 6e 6f |titute o|f Techno|
|000000f0| 6c 6f 67 79 0a 44 61 74 | 65 3a 20 54 75 65 2c 20 |logy.Dat|e: Tue, |
|00000100| 32 37 20 46 65 62 20 31 | 39 39 36 20 31 30 3a 34 |27 Feb 1|996 10:4|
|00000110| 32 3a 35 30 20 47 4d 54 | 0a 4d 65 73 73 61 67 65 |2:50 GMT|.Message|
|00000120| 2d 49 44 3a 20 3c 50 69 | 6e 65 2e 53 56 34 2e 33 |-ID: <Pi|ne.SV4.3|
|00000130| 2e 39 31 2d 68 65 62 2d | 32 2e 30 34 2e 39 36 30 |.91-heb-|2.04.960|
|00000140| 32 32 37 31 32 34 30 34 | 35 2e 33 39 32 36 44 2d |22712404|5.3926D-|
|00000150| 31 30 30 30 30 30 40 63 | 73 2e 74 65 63 68 6e 69 |100000@c|s.techni|
|00000160| 6f 6e 2e 61 63 2e 69 6c | 3e 0a 4d 69 6d 65 2d 56 |on.ac.il|>.Mime-V|
|00000170| 65 72 73 69 6f 6e 3a 20 | 31 2e 30 0a 49 6e 2d 52 |ersion: |1.0.In-R|
|00000180| 65 70 6c 79 2d 54 6f 3a | 20 3c 31 37 37 33 39 39 |eply-To:| <177399|
|00000190| 37 30 32 53 38 36 2e 4a | 57 31 36 37 35 41 40 61 |702S86.J|W1675A@a|
|000001a0| 6d 65 72 69 63 61 6e 2e | 65 64 75 3e 20 0a 58 2d |merican.|edu> .X-|
|000001b0| 4e 6e 74 70 2d 50 6f 73 | 74 69 6e 67 2d 48 6f 73 |Nntp-Pos|ting-Hos|
|000001c0| 74 3a 20 63 73 64 2e 63 | 73 2e 74 65 63 68 6e 69 |t: csd.c|s.techni|
|000001d0| 6f 6e 2e 61 63 2e 69 6c | 0a 52 65 66 65 72 65 6e |on.ac.il|.Referen|
|000001e0| 63 65 73 3a 20 3c 31 37 | 37 33 39 39 37 30 32 53 |ces: <17|7399702S|
|000001f0| 38 36 2e 4a 57 31 36 37 | 35 41 40 61 6d 65 72 69 |86.JW167|5A@ameri|
|00000200| 63 61 6e 2e 65 64 75 3e | 20 0a 53 65 6e 64 65 72 |can.edu>| .Sender|
|00000210| 3a 20 6e 65 77 73 40 64 | 69 73 63 75 73 2e 74 65 |: news@d|iscus.te|
|00000220| 63 68 6e 69 6f 6e 2e 61 | 63 2e 69 6c 20 28 4e 65 |chnion.a|c.il (Ne|
|00000230| 77 73 20 73 79 73 74 65 | 6d 29 0a 58 2d 53 65 6e |ws syste|m).X-Sen|
|00000240| 64 65 72 3a 20 65 6d 69 | 6c 64 40 63 73 64 0a 0a |der: emi|ld@csd..|
|00000250| 0a 0a 4f 6e 20 4d 6f 6e | 2c 20 32 36 20 46 65 62 |..On Mon|, 26 Feb|
|00000260| 20 31 39 39 36 2c 20 4a | 61 6d 65 73 20 44 2e 20 | 1996, J|ames D. |
|00000270| 57 61 74 73 6f 6e 20 77 | 72 6f 74 65 3a 0a 0a 3e |Watson w|rote:..>|
|00000280| 20 48 69 20 66 6f 6c 6b | 73 20 2d 2d 0a 3e 20 0a | Hi folk|s --.> .|
|00000290| 3e 20 61 66 74 65 72 20 | 72 65 61 64 69 6e 67 20 |> after |reading |
|000002a0| 74 68 65 20 46 41 51 20 | 65 6e 74 72 69 65 73 20 |the FAQ |entries |
|000002b0| 61 62 6f 75 74 20 71 73 | 6f 72 74 2c 20 49 20 74 |about qs|ort, I t|
|000002c0| 68 6f 75 67 68 74 20 49 | 20 68 61 64 20 6d 79 20 |hought I| had my |
|000002d0| 70 72 6f 62 6c 65 6d 0a | 3e 20 6c 69 63 6b 65 64 |problem.|> licked|
|000002e0| 2c 20 62 75 74 20 69 74 | 20 73 65 65 6d 73 20 6e |, but it| seems n|
|000002f0| 6f 74 2e 0a 3e 20 0a 3e | 20 41 72 63 68 69 74 65 |ot..> .>| Archite|
|00000300| 63 74 75 72 65 3a 20 53 | 75 6e 4f 53 20 34 2e 31 |cture: S|unOS 4.1|
|00000310| 2e 33 20 77 69 74 68 20 | 41 4e 53 49 2d 43 20 63 |.3 with |ANSI-C c|
|00000320| 6f 6d 70 69 6c 65 72 2e | 0a 3e 20 0a 3e 20 49 27 |ompiler.|.> .> I'|
|00000330| 6d 20 64 6f 69 6e 67 20 | 73 6f 6d 65 20 66 69 6c |m doing |some fil|
|00000340| 65 20 6d 61 6e 69 70 75 | 6c 61 74 69 6f 6e 20 61 |e manipu|lation a|
|00000350| 6e 64 20 62 65 74 77 65 | 65 6e 20 73 74 65 70 73 |nd betwe|en steps|
|00000360| 20 41 20 61 6e 64 20 42 | 2c 20 49 20 6e 65 65 64 | A and B|, I need|
|00000370| 20 74 6f 20 73 6f 72 74 | 2e 0a 3e 20 46 6f 72 20 | to sort|..> For |
|00000380| 76 61 72 69 6f 75 73 20 | 72 65 61 73 6f 6e 73 2c |various |reasons,|
|00000390| 20 49 20 64 6f 6e 27 74 | 20 77 61 6e 74 20 74 6f | I don't| want to|
|000003a0| 20 70 6f 70 65 6e 28 29 | 20 74 6f 20 74 68 65 20 | popen()| to the |
|000003b0| 73 6f 72 74 20 75 74 69 | 6c 69 74 79 2d 2d 49 20 |sort uti|lity--I |
|000003c0| 77 61 6e 74 20 74 6f 0a | 3e 20 75 73 65 20 71 73 |want to.|> use qs|
|000003d0| 6f 72 74 2e 20 20 48 65 | 72 65 27 73 20 77 68 61 |ort. He|re's wha|
|000003e0| 74 20 49 27 6d 20 64 6f | 69 6e 67 3a 0a 3e 20 0a |t I'm do|ing:.> .|
|000003f0| 3e 20 20 67 65 74 20 6e | 75 6d 62 65 72 20 6f 66 |> get n|umber of|
|00000400| 20 6c 69 6e 65 73 20 69 | 6e 20 74 68 65 20 66 69 | lines i|n the fi|
|00000410| 6c 65 0a 3e 20 20 28 63 | 68 61 72 2a 2a 29 6d 61 |le.> (c|har**)ma|
|00000420| 6c 6c 6f 63 20 77 69 74 | 68 20 65 6e 6f 75 67 68 |lloc wit|h enough|
|00000430| 20 72 6f 6f 6d 20 66 6f | 72 20 61 6c 6c 20 6c 69 | room fo|r all li|
|00000440| 6e 65 73 0a 3e 20 20 66 | 6f 72 20 65 61 63 68 20 |nes.> f|or each |
|00000450| 6c 69 6e 65 20 69 6e 20 | 74 68 65 20 66 69 6c 65 |line in |the file|
|00000460| 20 7b 0a 3e 20 20 20 20 | 28 63 68 61 72 2a 29 6d | {.> |(char*)m|
|00000470| 61 6c 6c 6f 63 28 39 30 | 29 20 20 2f 2a 20 39 30 |alloc(90|) /* 90|
|00000480| 20 69 73 20 65 6e 6f 75 | 67 68 20 72 6f 6f 6d 20 | is enou|gh room |
|00000490| 66 6f 72 20 65 61 63 68 | 20 6c 69 6e 65 20 69 6e |for each| line in|
|000004a0| 20 66 69 6c 65 20 2a 2f | 0a 3e 20 20 20 20 63 6f | file */|.> co|
|000004b0| 70 79 20 65 61 63 68 20 | 6c 69 6e 65 20 69 6e 74 |py each |line int|
|000004c0| 6f 20 74 68 65 20 6e 65 | 77 6c 79 20 6d 61 6c 6c |o the ne|wly mall|
|000004d0| 6f 63 28 29 65 64 20 73 | 70 61 63 65 0a 3e 20 20 |oc()ed s|pace.> |
|000004e0| 20 20 70 6f 69 6e 74 20 | 61 20 28 63 68 61 72 2a | point |a (char*|
|000004f0| 2a 29 20 74 6f 20 74 68 | 65 20 6e 65 77 6c 79 20 |*) to th|e newly |
|00000500| 6d 61 6c 6c 6f 63 28 29 | 65 64 20 73 70 61 63 65 |malloc()|ed space|
|00000510| 0a 3e 20 20 7d 0a 3e 20 | 0a 3e 20 73 6f 20 6e 6f |.> }.> |.> so no|
|00000520| 77 20 49 20 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |w I shou|ld have |
|00000530| 22 6c 69 6e 65 73 22 20 | 6e 75 6d 62 65 72 20 6f |"lines" |number o|
|00000540| 66 20 70 6f 69 6e 74 65 | 72 73 20 74 6f 20 70 6f |f pointe|rs to po|
|00000550| 69 6e 74 65 72 73 20 74 | 6f 20 63 68 61 72 2c 0a |inters t|o char,.|
|00000560| 3e 20 65 61 63 68 20 6f | 6e 65 20 70 6f 69 6e 74 |> each o|ne point|
|00000570| 69 6e 67 20 74 6f 20 39 | 30 20 62 79 74 65 73 20 |ing to 9|0 bytes |
|00000580| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 61 20 6c 69 6e |containi|ng a lin|
|00000590| 65 20 69 6e 20 74 68 65 | 20 66 69 6c 65 2e 0a 3e |e in the| file..>|
|000005a0| 20 0a 3e 20 53 6f 2c 20 | 49 20 63 61 6c 6c 20 71 | .> So, |I call q|
|000005b0| 73 6f 72 74 28 61 72 72 | 61 79 5b 30 5d 2c 20 6c |sort(arr|ay[0], l|
|000005c0| 69 6e 65 73 2c 20 39 30 | 2c 20 63 6f 6d 70 61 72 |ines, 90|, compar|
|000005d0| 65 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e). | |
|000005e0| 20 20 20 20 20 20 5e 2d | 2d 2d 2d 2d 2d 2d 2d 2d | ^-|--------|
|000005f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 4d |--------|-------M|
|00000600| 55 53 54 4e 27 74 20 74 | 68 65 72 65 20 62 65 20 |USTN't t|here be |
|00000610| 26 61 72 72 61 79 5b 30 | 5d 3f 3f 0a 20 20 20 20 |&array[0|]??. |
|00000620| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000630| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000640| 20 20 20 20 20 20 20 20 | 20 4f 52 20 61 72 72 61 | | OR arra|
|00000650| 79 20 3f 3f 0a 3e 20 77 | 68 65 72 65 20 63 6f 6d |y ??.> w|here com|
|00000660| 70 61 72 65 20 69 73 20 | 6d 79 20 63 6f 6d 70 61 |pare is |my compa|
|00000670| 72 69 73 6f 6e 20 66 75 | 6e 63 74 69 6f 6e 20 2d |rison fu|nction -|
|00000680| 2d 20 70 72 65 70 61 72 | 65 64 20 61 73 20 64 69 |- prepar|ed as di|
|00000690| 73 63 75 73 73 65 64 0a | 3e 20 69 6e 20 74 68 65 |scussed.|> in the|
|000006a0| 20 46 41 51 2e 20 20 4e | 6f 77 20 61 6c 6c 20 49 | FAQ. N|ow all I|
|000006b0| 20 67 65 74 20 61 72 65 | 20 63 6f 72 65 20 64 75 | get are| core du|
|000006c0| 6d 70 73 20 64 75 72 69 | 6e 67 20 74 68 65 20 63 |mps duri|ng the c|
|000006d0| 61 6c 6c 20 74 6f 20 71 | 73 6f 72 74 28 29 2e 0a |all to q|sort()..|
|000006e0| 3e 20 3a 2d 29 0a 3e 20 | 0a 3e 20 54 68 65 20 63 |> :-).> |.> The c|
|000006f0| 6f 72 65 20 64 75 6d 70 | 20 69 73 6e 27 74 20 69 |ore dump| isn't i|
|00000700| 6e 20 6d 79 20 63 6f 6d | 70 61 72 65 20 72 6f 75 |n my com|pare rou|
|00000710| 74 69 6e 65 20 2d 2d 20 | 69 74 27 73 20 73 6f 6d |tine -- |it's som|
|00000720| 65 77 68 65 72 65 20 65 | 6c 73 65 20 69 6e 0a 3e |ewhere e|lse in.>|
|00000730| 20 74 68 65 20 71 73 6f | 72 74 28 29 20 66 75 6e | the qso|rt() fun|
|00000740| 63 74 69 6f 6e 20 61 63 | 63 6f 72 64 69 6e 67 20 |ction ac|cording |
|00000750| 74 6f 20 64 62 78 20 2d | 2d 20 73 6f 20 49 27 6d |to dbx -|- so I'm|
|00000760| 20 73 75 72 65 20 69 74 | 27 73 20 61 20 70 72 6f | sure it|'s a pro|
|00000770| 62 6c 65 6d 0a 3e 20 73 | 65 74 74 69 6e 67 20 75 |blem.> s|etting u|
|00000780| 70 20 6d 79 20 64 61 74 | 61 2e 0a 3e 20 0a 3e 20 |p my dat|a..> .> |
|00000790| 41 6e 79 20 74 69 70 73 | 3f 20 20 4d 75 63 68 20 |Any tips|? Much |
|000007a0| 61 70 70 72 65 63 69 61 | 74 69 6f 6e 20 69 6e 20 |apprecia|tion in |
|000007b0| 61 64 76 61 6e 63 65 2c | 0a 3e 20 52 65 67 61 72 |advance,|.> Regar|
|000007c0| 64 73 2c 0a 3e 20 4a 69 | 6d 0a 3e 20 0a 0a 48 6f |ds,.> Ji|m.> ..Ho|
|000007d0| 70 65 20 74 68 69 73 20 | 68 65 6c 70 73 2e 0a 0a |pe this |helps...|
|000007e0| 09 09 09 09 09 09 52 65 | 67 61 72 64 73 2c 0a 0a |......Re|gards,..|
|000007f0| 0a 09 09 09 09 09 09 09 | 09 45 6d 69 6c 0a |........|.Emil. |
+--------+-------------------------+-------------------------+--------+--------+